<template>
	<view class="page-terms">
		<view class="page-ctx">
			<view class="page-inner">
				<view class="rich-box">
					<view class="detail-ctx">
						<view class="html-box">
							<u-parse :content="info.content"></u-parse>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				id: '',
				title: '',
				info: {
					title: '',
					jianjie: '',
					createdTime: '',
					content: '',
				},
				richStyle: {
					// 字符串的形式
					p: 'color: #000000;font-size: 12px;line-height:1.6;font-family: PingFangSC-Regular;text-align:justify;',
					span: 'color: #000000;font-size: 12px;line-height:1.6;font-family: PingFangSC-Regular;',
					img: 'vertical-align: bottom;'
				}
			}
		},
		onLoad(option) {
			this.id = option.id || '';
			this.title = option.title || '';
			uni.setNavigationBarTitle({
				title: this.title
			})
			this.setView()
		},
		methods: {
			setView() {
				this.showLoading();
				this.$api({
					url: '/service.php',
					method: 'get',
					data: {
						action: 'news_detail',
						id: this.id,
					},
				}).then(res => {
					if (res.code == 200) {
						this.info = res.data.info;
					}

					setTimeout(() => {
						this.hideLoading()
					}, 300)
				})
			},
		},
	}
</script>

<style>
	.page-terms {
		padding: 24rpx;
		font-size: 30rpx;
		line-height: 1.7;
		padding-bottom: 100rpx;
	}
</style>